#pragma once

// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license

// ShaderEvent.h : interface of the ShaderEvent and ShaderListener classes
//

class ShaderProgram;
class ShaderManager;
class Shader;
class UniformVar;

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

class ShaderEvent
{
public:
    enum
    {
        ShaderProgramAdded,
        ShaderProgramRemoved,
        VertexShaderAdded,
        VertexShaderRemoved,
        FragmentShaderAdded,
        FragmentShaderRemoved,
        UniformVariableChanged,
        ShaderCodeChanged,
        Other
    };

    ShaderEvent(int type=Other) 
    : type(type), sender(NULL), program(NULL), shader(NULL), uniVar(NULL)
    {
    }
    
    int type;

    // Some of those might be NULL depending on type of the event
    ShaderManager* sender;
    ShaderProgram* program;
    Shader* shader;
    UniformVar* uniVar;
};

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

class ShaderListener 
{
public:
    virtual void onShaderEvent(const ShaderEvent&) 
    { 
    }
};

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
